<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>企业注册</title>
    <link rel="stylesheet" href="layui/css/layui.css">
    <link rel="stylesheet" href="css/admin.css">
</head>
<body class="body2">
<div id="container">
    <div></div>
    <div class="admin-login-background">
        <!--<div class="admin-header">-->
        <!--<img src="image/ex_logo.png" class="admin-logo">-->
        <!--</div>-->
        <form class="layui-form" action="" lay-filter="example">
            <div>
                <i class="layui-icon layui-icon-username admin-icon admin-icon-username"></i>
                <input type="text" name="account" placeholder="请输入用户名"
                       autocomplete="off"
                       class="layui-input admin-input admin-input-username">
            </div>
            <div>
                <i class="layui-icon layui-icon-password admin-icon admin-icon-password"></i>
                <input type="password" name="password"
                       placeholder="请输入密码"
                       autocomplete="off"
                       class="layui-input admin-input">
            </div>

            <button type="button" class="layui-btn  admin-button" id="bt_login">注册</button>


        </form>
    </div>
</div>
<script src="layui/layui.js"></script>
<script>
    layui.use(['form', 'layedit', 'laydate',"upload",], function(){
        var form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,upload = layui.upload
            ,laydate = layui.laydate;




        //表单取值
        layui.$('#bt_login').on('click', function(){
            var data = form.val('example');



            layui.jquery.ajax({
                url:"http://localhost:8080/company/register",
                data:{'account':data.account,"pwd":data.password},
                type:"Post",
                success:function(result){
                    console.log(result);
                    layer.msg(result.msg);
                     if (result.msg=="注册成功"){
                         layui.data('user', {
                             key: 'id'
                             ,value: result.data.id
                         });
                         location.href="companyinfo.html";


                     }
                },
                error:function(result){
                    // $.messager.alert('错误',result.msg);
                }
            });


        });


    });
</script>




</body>
</html>
